home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / arexx-scripts / arexx-pack / apiglibv33.lha / APIG_Lib / easyrequest2.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1992-02-09  |  1.8 KB  |  56 lines

  1. /* Example of EasyRequester with variable arglist */
  2.  
  3. x = addlib("apig.library",0,-30,0)
  4.  
  5. call set_apig_globals()
  6.  
  7. portname = "easyreq2_port"     
  8. p = openport(portname)  
  9. WaitForPort portname  
  10.  
  11. wintitle = "Easy Requester Example"
  12.  
  13. winidcmp = IDCMP_CLOSEWINDOW 
  14.                              
  15. winflags = WFLG_CLOSEGADGET+WFLG_DRAGBAR+WFLG_SIZEGADGET+WFLG_DEPTHGADGET+WFLG_GIMMEZEROZERO
  16.  
  17. win = openwindow(portname,0,0,640,200,2,4,winidcmp,winflags,wintitle,null(),0,0,0)
  18.  
  19. arglist = ALLOCMEM(100,MEMF_CLEAR) /* our arglist */
  20.  
  21. /* stuff data into arglist */
  22.         name = allocmem(80,MEMF_CLEAR)        /* points to my name   */
  23.         call export(name,"Ronnie E. Kelly")   /* copy name to buffer */
  24.  
  25.         dob = allocmem(80,MEMF_CLEAR)
  26.         call export(dob,"04/23/17")
  27.  
  28.         call SETVALUE(arglist,0,4,'p',name)   /* set 1st arg, name */
  29.         call SETVALUE(arglist,4,4,'n',75)     /* ... 2nd, age      */
  30.         call SETVALUE(arglist,8,4,'n',383)    /* ... 3nd, weight   */
  31.         call SETVALUE(arglist,12,4,'p',dob)   /* ... 4nd, dob      */
  32.  
  33. /* gad args follow textformat args */
  34.         call SETVALUE(arglist,16,4,'n',1)     /* gad 1       */
  35.         call SETVALUE(arglist,20,4,'n',2)     /* gad 2       */
  36.         call SETVALUE(arglist,24,4,'n',0)     /* gad 0       */
  37.  
  38. wtext = "This is your EasyRequester"
  39.  
  40. /* NOTE 'C' style formatting chars ...  %s, %ld, etc. */
  41.  
  42. rtext =          " Say Buddy This is your Easy Requester " '0a'x '0a'x
  43. rtext = rtext || " Your Name Is %s " '0a'x "Your Age Is %ld " '0a'x
  44. rtext = rtext || " Your Weight Is %ld " '0a'x "Your Date of Birth Is %s " '0a'x
  45.  
  46. gtext = " %ld). OKAY | %ld). MAYBE | %ld). NOWAY "
  47.  
  48. x = EASYREQUEST(win,wtext,rtext,gtext,arglist,0,0)
  49.  
  50. call CLOSEWINDOW(win)
  51. call FREEMEM(arglist,100)
  52. call FREEMEM(dob,80)
  53. call FREEMEM(name,80)
  54. exit
  55.  
  56.